
import java.util.Arrays;
import java.util.Scanner;


public class Input{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String input = new String();

        String[] nm = sc.nextLine().split("\\s+");
        int n=Integer.parseInt(nm[0]);
        int m=Integer.parseInt(nm[1]);


        //遇到空行则退出循环,即按两次回车
        while (!(input=sc.nextLine()).isEmpty()){

            String[] strs = input.split("\\s+");

            Arrays.stream(strs).forEach(System.out::println);

            System.out.println(input);
        }
    }

}